package com.cgx.dao;

import com.cgx.entity.message.Session;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.awt.print.Pageable;
import java.util.Date;
import java.util.List;

@Repository
public interface SessionDao extends MongoRepository<Session, String> {
    List<Session> findAllBySessionIdAndIsDelete(String sessionId, Integer isDelete);

    List<Session> findAllBySessionIdInAndIsDelete(List<String> idList, Integer isDelete);

    List<Session> findAllBySessionIdInAndIsDeleteAndLastMessageTimeBeforeOrderByLastMessageTimeDesc(List<String> sessionList, int isDelete, Date lastMessage);
}
